
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<jsp:include page="inc.jsp"></jsp:include>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	function update(){
		var isValid = $("#purViewEditForm").form('validate');
		if (!isValid){
			return;
		}
		var sort = $("#subSysSort").val();
		 var re = /^[0-9]*[1-9][0-9]*$/ ;
		if(!re.test(sort)){
			parent.$.messager.alert('提示',"排列序号必须是整数", 'info');
			parent.$.modalDialog.handler.dialog('close');
			   return;
			}
		var subSysName = $("#subSysName").val();
		if(subSysName.length>25){
			parent.$.messager.alert('提示',"最长不超过25个汉字", 'info');
			parent.$.modalDialog.openner_treeGrid.treegrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_treeGrid这个对象，是因为pueViewList.jsp页面预定义好了
			parent.$.modalDialog.handler.dialog('close');
			   return;
			}
		$('#purViewEditForm').ajaxSubmit(
				{
					url : "${ctx}/user/updateModule",
					type : "post",
					dataType : 'json',
					success : function(result) {
						progressClose();
					
						if (result.state==1) {
							parent.show("编辑成功","提示");
							parent.$.modalDialog.handler.dialog('close');
						}else if(result.state==2){
							parent.$.messager.alert('提示',"排序等级已经存在", 'info');
							
							parent.$.modalDialog.handler.dialog('close');
						}else{
							parent.$.messager.alert('错误', result, 'error');
						}
					}
				});
	}
</script>
<div style="padding: 3px;">
	<form id="purViewEditForm" method="post">
		<table  class="grid" style="border: 0">
			<tr><td style="width: 20%;height: 55px"><input name="purCode" type="hidden"  value="${subSysParam.purCode}" ></td>
				<td style="width:8%;">展示名称:<input name="id" type="hidden"  value="${subSysParam.id}" ></td>
				<td><input name="subSysName" id="subSysName" type="text" placeholder="请输入权限点名称" value="${subSysParam.subSysName}" class="easyui-validatebox span2" data-options="required:true" ><font color="red" style="font-weight:bold;" face="verdana">*</font></td>
			
			</tr>
			<tr>
			<td style="width: 20%;height: 55px;"></td>
				<td>排列序号:</td>
				<td><input name="subSysSort" id="subSysSort" type="text" placeholder="请按照规则填写code" value="${subSysParam.subSysSort}" class="easyui-validatebox span2" data-options="required:true,width:140,height:29" ><font color="red" style="font-weight:bold;" face="verdana">*</font></td>
			</tr>
			<tr>
			<td style="width: 20%;height: 55px;"></td>
			   <td>背景图片:</td>
				<td><input  name="subSysImg" value="${subSysParam.subSysImg}"/></td>
				
			</tr>
			<tr>
			<td style="width: 20%;height: 55px;"></td>
				<td>访问路径:</td>
				<td><input name="subSysUrl" type="text" value="${subSysParam.subSysUrl}" placeholder="请输入访问路径" class="easyui-validatebox span2"  data-options="required:true"><font color="red" style="font-weight:bold;" face="verdana">*</font></td>
				
			</tr>
			<tr></tr>
			<tr><td style="width: 20%;height: 55px;"></td><td></td>
				<td><input type="button" value="编辑" onclick="update()"></td></tr>
			
		</table>
	</form>
</div>
